import * as type from './mutation-types'
export const state = {
    // Appsflyer 历史补发中台用户列表
    supplementHistoryListInfo: {},
    supplementHistoryListStatus: '',
    // Appsflyer 校验补发历史任务查询
    verifyTaskHistoryListInfo: {},
    verifyTaskHistoryListStatus: '',
    // Appsflyer 订单事件真伪判断
    checkFakeOrderInfo: {},
    checkFakeOrderStatus: '',
    // 校验 Appsflyer 漏报的设备信息
    verifyMissingDeviceInfo: {},
    verifyMissingDeviceStatus: '',
    // 前端定时轮询查询校验进度
    checkBatchVerifyProcessInfo: {},
    checkBatchVerifyProcessStatus: '',
    // 查询Appsflyer 漏报校验结果
    verifyResultInfo: {},
    verifyResultStatus: '',
    // Appsflyer 校验补充
    supplementMissingDataInfo: {},
    supplementMissingDataStatus: '',
    supplementMissingDataCode: '',
    // 删除历史补发
    deleteSupplementHistoryInfo: {},
    deleteSupplementHistoryStatus: '',
    // Appsflyer 查询中台账号历史三个月的登录行为
    loginInfoListInfo: {},
    loginInfoListStatus: '',
}
export const mutations = {
    // Appsflyer 历史补发中台用户列表
    [type.SUPPLEMENTHISTORYLIST_REQUEST](state) {
        state.supplementHistoryListStatus = 'loading';
        state.supplementHistoryListInfo = {};
    },
    [type.SUPPLEMENTHISTORYLIST_RECEIVE](state, res) {
        state.supplementHistoryListStatus = 'loaded';
        state.supplementHistoryListInfo = res?.content || {};
    },
    // Appsflyer 校验补发历史任务查询
    [type.VERIFYTASKHISTORYLIST_REQUEST](state) {
        state.verifyTaskHistoryListStatus = 'loading';
        state.verifyTaskHistoryListInfo = {};
    },
    [type.VERIFYTASKHISTORYLIST_RECEIVE](state, res) {
        state.verifyTaskHistoryListStatus = 'loaded';
        state.verifyTaskHistoryListInfo = res?.content || {};
    },
    // Appsflyer 订单事件真伪判断
    [type.CHECKFAKEORDER_REQUEST](state) {
        state.checkFakeOrderStatus = 'loading';
        state.checkFakeOrderInfo = {};
    },
    [type.CHECKFAKEORDER_RECEIVE](state, res) {
        state.checkFakeOrderStatus = 'loaded';
        state.checkFakeOrderInfo = res?.content || {};
    },
    // 校验 Appsflyer 漏报的设备信息
    [type.VERIFYMISSINGDEVICE_REQUEST](state) {
        state.verifyMissingDeviceStatus = 'loading';
        state.verifyMissingDeviceInfo = {};
    },
    [type.VERIFYMISSINGDEVICE_RECEIVE](state, res) {
        state.verifyMissingDeviceStatus = 'loaded';
        state.verifyMissingDeviceInfo = res?.content || {};
    },
    // 前端定时轮询查询校验进度
    [type.CHECKBATCHVERIFYPROCESS_REQUEST](state) {
        state.checkBatchVerifyProcessStatus = 'loading';
        state.checkBatchVerifyProcessInfo = {};
    },
    [type.CHECKBATCHVERIFYPROCESS_RECEIVE](state, res) {
        state.checkBatchVerifyProcessStatus = 'loaded';
        state.checkBatchVerifyProcessInfo = res?.content || {};
    },
    // 查询Appsflyer 漏报校验结果
    [type.VERIFYRESULT_REQUEST](state) {
        state.verifyResultStatus = 'loading';
        state.verifyResultInfo = {};
    },
    [type.VERIFYRESULT_RECEIVE](state, res) {
        state.verifyResultStatus = 'loaded';
        state.verifyResultInfo = res?.content || {};
    },
    // Appsflyer 校验补充
    [type.SUPPLEMENTMISSINGDATA_REQUEST](state) {
        state.supplementMissingDataStatus = 'loading';
        state.supplementMissingDataInfo = {};
    },
    [type.SUPPLEMENTMISSINGDATA_RECEIVE](state, res) {
        state.supplementMissingDataStatus = 'loaded';
        console.log(res.code, '---=-=--=');

        if (res.code) {
            state.supplementMissingDataCode = res.code

        }
        state.supplementMissingDataInfo = res?.content || {};
    },
    // 删除历史补发
    [type.DELETESUPPLEMENTHISTORY_REQUEST](state) {
        state.deleteSupplementHistoryStatus = 'loading';
        state.deleteSupplementHistoryInfo = {};
    },
    [type.DELETESUPPLEMENTHISTORY_RECEIVE](state, res) {
        state.deleteSupplementHistoryStatus = 'loaded';
        state.deleteSupplementHistoryInfo = res?.content || {};
    },
    // Appsflyer 查询中台账号历史三个月的登录行为
    [type.LOGININFOLIST_REQUEST](state) {
        state.loginInfoListStatus = 'loading';
        state.loginInfoListInfo = {};
    },
    [type.LOGININFOLIST_RECEIVE](state, res) {
        state.loginInfoListStatus = 'loaded';
        state.loginInfoListInfo = res?.content || {};
    },
}